package com.hdax.dm.feign.user;

import com.hdax.dm.entity.user.DmUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name="dm-user-provider")
public interface DmUserFeign {
    /**
     * 根据手机号查询用户信息
     * @param phoneNumber
     * @return
     */
    @PostMapping(path = "/user/findByPhone")
    DmUser findByPhone(@RequestParam("phoneNumber")String phoneNumber);

    /**
     * 根据id查询用户信息
     * @param id
     * @return
     */
    @PostMapping(path = "/user/findById")
    DmUser findById(@RequestParam("id")Long id);

    /**
     * 修改用户信息
     * @param dmUser
     * @return
     */
    @PostMapping(path = "/user/updateUserInfo")
    int updateUserInfo(@RequestBody DmUser dmUser);

    /**
     * 添加用户
     * @param dmUser
     * @return
     */
    @PostMapping(path = "/user/addUserInfo")
    int addUserInfo(@RequestBody DmUser dmUser);
}
